﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Starry.SmartAjax
{
    public class BizTranscation : ITransactable, IBizTranscation
    {
        internal BizTranscation(ITransactable bizEntity)
        {
            this.transcationList = new List<ITransactable>() { bizEntity };
        }

        private List<ITransactable> transcationList;

        public void Commit()
        {
            foreach (var transcation in this.transcationList)
            {
                transcation.Commit();
            }
        }

        public void Rollback()
        {
            foreach (var transcation in this.transcationList)
            {
                transcation.Rollback();
            }
        }
    }
}
